-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(deps): update dependency @apollo/client to v3.9.5 - autoclosed #890
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## main #890 +/- ##
=======================================
Coverage 25.49% 25.49%
=======================================
Files 1 1
Lines 51 51
Branches 21 21
=======================================
Hits 13 13
Misses 27 27
Partials 11 11 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
430a276
to
6be675d
Compare
⚠ Artifact update problemRenovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below: File name: package-lock.json
|
6be675d
to
27e10a3
Compare
27e10a3
to
e4d7d80
Compare
e4d7d80
to
5ca1f2c
Compare
5ca1f2c
to
7362c21
Compare
7362c21
to
1df688f
Compare
1df688f
to
4bc1a6e
Compare
4bc1a6e
to
e7120ca
Compare
e7120ca
to
4680f9a
Compare
4680f9a
to
f42dd10
Compare
c282ea5
to
385165c
Compare
385165c
to
4d1367f
Compare
4d1367f
to
3c8349a
Compare
3c8349a
to
04ae5b4
Compare
04ae5b4
to
f45eb3a
Compare
f45eb3a
to
e99b8e9
Compare
e99b8e9
to
256a5e9
Compare
256a5e9
to
7294792
Compare
7294792
to
80027a7
Compare
This PR contains the following updates:
3.3.21
->3.9.5
Release Notes
apollographql/apollo-client (@apollo/client)
v3.9.5
Compare Source
Patch Changes
#11595
8c20955
Thanks @phryneas! - Bumps the dependencyrehackt
to 0.0.5#11592
1133469
Thanks @Stephen2! - StrengthenMockedResponse.newData
type#11579
1ba2fd9
Thanks @jerelmiller! - Fix issue where partial data is reported touseQuery
when usingnotifyOnNetworkStatusChange
after it errors while another overlapping query succeeds.#11579
1ba2fd9
Thanks @jerelmiller! - Fix an issue where a partial cache write for an errored query would result in automatically refetching that query.#11562
65ab695
Thanks @mspiess! - Mocks with an infinite delay no longer require result or errorv3.9.4
Compare Source
Patch Changes
#11403
b0c4f3a
Thanks @jerelmiller! - Fix issue inuseLazyQuery
that results in a double network call when calling the execute function with no arguments after having called it previously with another set of arguments.#11576
e855d00
Thanks @alessbell! - Revert PR #11202 to fix caching bug reported in #11560v3.9.3
Compare Source
Patch Changes
#11525
dce923a
Thanks @vezaynk! - Allows passing in client via options to useFragment#11558
8cba16f
Thanks @alessbell! - Fixunbound-method
linter error on ObservableQuery methods exposed on useQuery's QueryResult object.v3.9.2
Compare Source
Patch Changes
6ac2b0c
Thanks @jerelmiller! - Fix import inuseLazyRef
causing import issues in the nextjs package.v3.9.1
Compare Source
Patch Changes
#11516
8390fea
Thanks @phryneas! - Fix an incorrect string substitution in a warning message.#11515
c9bf93b
Thanks @vladar! - Avoid redundant refetchQueries call for mutation with no-cache policy (fixes #10238)#11545
84a6bea
Thanks @alessbell! - Remove error thrown byinFlightLinkObservables
intended to be removed before 3.9 release.v3.9.0
Compare Source
Minor Changes
Memory optimizations
#11424
62f3b6d
Thanks @phryneas! - Simplify RetryLink, fix potential memory leakHistorically,
RetryLink
would keep avalues
array of all previous values, in case the operation would get an additional subscriber at a later point in time.In practice, this could lead to a memory leak (#11393) and did not serve any further purpose, as the resulting observable would only be subscribed to by Apollo Client itself, and only once - it would be wrapped in a
Concast
before being exposed to the user, and thatConcast
would handle subscribers on its own.#11435
5cce53e
Thanks @phryneas! - DeprecatescanonizeResults
.Using
canonizeResults
can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.#11254
d08970d
Thanks @benjamn! - DecouplecanonicalStringify
fromObjectCanon
for better time and memory performance.#11356
cc4ac7e
Thanks @phryneas! - Fix a potential memory leak inFragmentRegistry.transform
andFragmentRegistry.findFragmentSpreads
that would hold on to passed-inDocumentNodes
for too long.#11370
25e2cb4
Thanks @phryneas! -parse
function: improve memory managementWeakCache
instead ofMap
to keep a limited number of parsed resultsparse.resetCache()
method#11389
139acd1
Thanks @phryneas! -documentTransform
: useoptimism
andWeakCache
instead of directly storing data on theTrie
#11358
7d939f8
Thanks @phryneas! - Fixes a potential memory leak inConcast
that might have been triggered whenConcast
was used outside of Apollo Client.#11344
bd26676
Thanks @phryneas! - Add aresetCache
method toDocumentTransform
and hookInMemoryCache.addTypenameTransform
up toInMemoryCache.gc
#11367
30d17bf
Thanks @phryneas! -print
: useWeakCache
instead ofWeakMap
#11387
4dce867
Thanks @phryneas! -QueryManager.transformCache
: useWeakCache
instead ofWeakMap
#11369
2a47164
Thanks @phryneas! - Persisted Query Link: improve memory managementWeakCache
instead ofWeakMap
to keep a limited number of hash resultspersistedLink.resetHashCache()
method#10804
221dd99
Thanks @phryneas! - use WeakMap in React Native with Hermes#11355
7d8e184
Thanks @phryneas! - InMemoryCache.gc now also triggers FragmentRegistry.resetCaches (if there is a FragmentRegistry)#11409
2e7203b
Thanks @phryneas! - Adds an experimentalApolloClient.getMemoryInternals
helper#11343
776631d
Thanks @phryneas! - Addreset
method toprint
, hook up toInMemoryCache.gc
Suspense-enabled data fetching on user interaction with
useLoadableQuery
#11300
a815873
Thanks @jerelmiller! - Introduces a newuseLoadableQuery
hook. This hook works similarly touseBackgroundQuery
in that it returns aqueryRef
that can be used to suspend a component via theuseReadQuery
hook. It provides a more ergonomic way to load the query during a user interaction (for example when wanting to preload some data) that would otherwise be clunky withuseBackgroundQuery
.Begin preloading outside of React with
createQueryPreloader
58db5c3
Thanks @jerelmiller! - Add the ability to start preloading a query outside React to begin fetching as early as possible. CallcreateQueryPreloader
to create apreloadQuery
function which can be called to start fetching a query. This returns aqueryRef
which is passed touseReadQuery
and suspended until the query is done fetching.Testing utility improvements
#11178
4d64a6f
Thanks @sebakerckhof! - Support re-using of mocks in the MockedProvider#6701
8d2b4e1
Thanks @prowe! - Ability to dynamically match mocksAdds support for a new property
MockedResponse.variableMatcher
: a predicate function that accepts avariables
param. Iftrue
, thevariables
will be passed into theResultFunction
to help dynamically build a response.New
useQueryRefHandlers
hook#11412
58db5c3
Thanks @jerelmiller! - Create a newuseQueryRefHandlers
hook that returnsrefetch
andfetchMore
functions for a givenqueryRef
. This is useful to get access to handlers for aqueryRef
that was created bycreateQueryPreloader
or when the handlers for aqueryRef
produced by a different component are inaccessible.Bail out of
optimisticResponse
updates with theIGNORE
sentinel object#11410
07fcf6a
Thanks @sf-twingate! - Allow returningIGNORE
sentinel object fromoptimisticResponse
functions to bail-out from the optimistic update.Consider this example:
The
IGNORE
sentinel can be destructured from the second parameter in the callback function signature passed tooptimisticResponse
.Network adapters for multipart subscriptions usage with Relay and urql
#11301
46ab032
Thanks @alessbell! - Add multipart subscription network adapters for Relay and urqlRelay
Urql
skipPollAttempt
callback function#11397
3f7eecb
Thanks @aditya-kumawat! - Adds a newskipPollAttempt
callback function that's called whenever a refetch attempt occurs while polling. If the function returnstrue
, the refetch is skipped and not reattempted until the next poll interval. This will solve the frequent use-case of disabling polling when the window is inactive.QueryManager.inFlightLinkObservables
now uses a strongTrie
as an internal data structure#11345
1759066
Thanks @phryneas!Warning: requires
@apollo/experimental-nextjs-app-support
updateIf you are using
@apollo/experimental-nextjs-app-support
, you will need to update that to at least 0.5.2, as it accesses this internal data structure.More Minor Changes
#11202
7c2bc08
Thanks @benjamn! - PreventQueryInfo#markResult
mutation ofresult.data
and return cache data consistently whether complete or incomplete.#11442
4b6f2bc
Thanks @jerelmiller! - Remove the need to callretain
fromuseLoadableQuery
sinceuseReadQuery
will now retain the query. This means that aqueryRef
that is not consumed byuseReadQuery
within the givenautoDisposeTimeoutMs
will now be auto diposed for you.Thanks to #11412, disposed query refs will be automatically resubscribed to the query when consumed by
useReadQuery
after it has been disposed.#11438
6d46ab9
Thanks @jerelmiller! - Remove the need to callretain
fromuseBackgroundQuery
sinceuseReadQuery
will now retain the query. This means that aqueryRef
that is not consumed byuseReadQuery
within the givenautoDisposeTimeoutMs
will now be auto diposed for you.Thanks to #11412, disposed query refs will be automatically resubscribed to the query when consumed by
useReadQuery
after it has been disposed.#11175
d6d1491
Thanks @phryneas! - To work around issues in React Server Components, especially with bundling forthe Next.js "edge" runtime we now use an external package to wrap
react
importsinstead of importing React directly.
#11495
1190aa5
Thanks @jerelmiller! - Increase the default memory limits forexecuteSelectionSet
andexecuteSelectionSetArray
.Patch Changes
#11275
3862f9b
Thanks @phryneas! - Add adefaultContext
option and property onApolloClient
, e.g. for keeping track of changing auth tokens or dependency injection.This can be used e.g. in authentication scenarios, where a new token might be generated outside of the link chain and should passed into the link chain.
#11443
ff5a332
Thanks @phryneas! - Adds a deprecation warning to the HOC and render prop APIs.The HOC and render prop APIs have already been deprecated since 2020,
but we previously didn't have a
@deprecated
tag in the DocBlocks.#11385
d9ca4f0
Thanks @phryneas! - ensuredefaultContext
is also used for mutations and subscriptions#11503
67f62e3
Thanks @jerelmiller! - Release changes fromv3.8.10
#11078
14edebe
Thanks @phryneas! - ObservableQuery: prevent reporting results of previous queries if the variables changed since#11439
33454f0
Thanks @jerelmiller! - Address bundling issue introduced in #11412 where thereact/cache
internals ended up duplicated in the bundle. This was due to the fact that we had areact/hooks
entrypoint that imported these files along with the newly introducedcreateQueryPreloader
function, which lived outside of thereact/hooks
folder.#11371
ebd8fe2
Thanks @phryneas! - Clarify types ofEntityStore.makeCacheKey
.v3.8.10
Compare Source
Patch Changes
#11489
abfd02a
Thanks @gronxb! - FixnetworkStatus
withuseSuspenseQuery
not properly updating to ready state when using acache-and-network
fetch policy that returns data equal to what is already in the cache.#11483
6394dda
Thanks @pipopotamasu! - Fix cache override warning outputv3.8.9
Compare Source
Patch Changes
#11472
afc844d
Thanks @alessbell! - Fix delay: Infinity when set on a MockResponse passed to Mocked Provider so it indefinitely enters loading state.#11464
aac12b2
Thanks @jerelmiller! - PreventuseFragment
from excessively unsubscribing and resubscribing the fragment with the cache on every render.#11449
f40cda4
Thanks @phryneas! - Removes refences to the typescript "dom" lib.#11470
e293bc9
Thanks @phryneas! - Remove an unnecessary check from parseAndCheckHttpResponse.v3.8.8
Compare Source
Patch Changes
#11200
ae5091a21
Thanks @jerelmiller! - Enablestrict
in tsconfig for the entire project.#11332
291aea56b
Thanks @asvishnyakov! - Add missed reexports of MutationFetchPolicy and RefetchWritePolicy to @apollo/client/core#10931
e5acf910e
Thanks @phryneas! -useMutation
: also reset internal state on resetv3.8.7
Compare Source
Patch Changes
#11297
c8c76a522
Thanks @jerelmiller! - Add an explicit return type for theuseReadQuery
hook calledUseReadQueryResult
. Previously the return type of this hook was inferred from the return value.#11337
bb1da8349
Thanks @phryneas! - #11206 used the TypeScript syntaxinfer X extends Y
that was introduced in TS 4.8.This caused some problems for some users, so we are rolling back to a more backwars-compatible (albeit slightly less performant) type.
v3.8.6
Compare Source
Patch Changes
#11291
2be7eafe3
Thanks @ArioA! - Fix a bug that allows to only callloadErrorMessages
without also callingloadDevErrorMessages
.#11274
b29f000f3
Thanks @jerelmiller! - Start the query ref auto dispose timeout after the initial promise has settled. This prevents requests that run longer than the timeout duration from keeping the component suspended indefinitely.#11289
b5894dbf0
Thanks @phryneas! -MockedProvider
: defaultconnectToDevTools
tofalse
in createdApolloClient
instance.This will prevent the mocked
ApolloClient
instance from trying to connect to the DevTools, which would start asetTimeout
that might keep running after a test has finished.#11206
dd2ce7687
Thanks @phryneas! -cache.modify
: Less strict types & new dev runtime warnings.v3.8.5
Compare Source
v3.8.4
Compare Source
Patch Changes
9e59b251d
Thanks @phryneas! - Forinvariant.log
etc., error arguments are now serialized correctly in the link to the error page.v3.8.3
Compare Source
Patch Changes
fd2a4cf0c
Thanks @phryneas! - Call devtools registration after ApolloClient is fully set up.v3.8.2
Compare Source
Patch Changes
#10072
51045c336
Thanks @Huulivoide! - Fixes race conditions in useReactiveVar that may prevent updates to the reactive variable from propagating through the hook.#11162
d9685f53c
Thanks @jerelmiller! - Ensures GraphQL errors returned in subscription payloads adhere to theerrorPolicy
set inclient.subscribe(...)
calls.#11134
96492e142
Thanks @alessbell! - Use separate type imports in useSuspenseQuery and useBackgroundQuery to workaround SWC compiler issue.#11117
6b8198109
Thanks @phryneas! - Adds a new devtools registration mechanism and tweaks the mechanism behind the"devtools not found" mechanic.
#11186
f1d429f32
Thanks @jerelmiller! - Fix an issue where race conditions when rapidly switching between variables would sometimes result in the wrongdata
returned from the query. Specifically this occurs when a query is triggered with an initial set of variables (VariablesA
), then triggers the same query with another set of variables (VariablesB
) but switches back to theVariablesA
before the response forVariablesB
is returned. Previously this would result in the data forVariablesB
to be displayed whileVariablesA
was active. The data is forVariablesA
is now properly returned.#11163
a8a9e11e9
Thanks @bignimbus! - Fix typo in error message: "occured" -> "occurred"#11180
7d9c481e5
Thanks @jerelmiller! - Fixes an issue where refetching fromuseBackgroundQuery
viarefetch
with an error after an error was already fetched would get stuck in a loading state.v3.8.1
Compare Source
Patch Changes
#11141
c469b1616
Thanks @jerelmiller! - Remove newly exported response iterator helpers that caused problems on some installs where@types/node
was not available.IMPORTANT
The following exports were added in version 3.8.0 that are removed with this patch.
isAsyncIterableIterator
isBlob
isNodeReadableStream
isNodeResponse
isReadableStream
isStreamableBlob
v3.8.0
Compare Source
Minor Changes
Fetching with Suspense 🎉
#10323
64cb88a4b
Thanks @jerelmiller! - Add support for React suspense with a newuseSuspenseQuery
hook.useSuspenseQuery
initiates a network request and causes the component calling it to suspend while the request is in flight. It can be thought of as a drop-in replacement foruseQuery
that allows you to take advantage of React's concurrent features while fetching during render.Consider a
Dog
component that fetches and renders some information about a dog named Mozzarella:View code 🐶
For a detailed explanation of
useSuspenseQuery
, see our fetching with Suspense reference.#10755
e3c676deb
Thanks @alessbell! - Feature: addsuseBackgroundQuery
anduseReadQuery
hooksuseBackgroundQuery
initiates a request for data in a parent component and returns aQueryReference
which is used to read the data in a child component viauseReadQuery
. If the child component attempts to render before the data can be found in the cache, the child component will suspend until the data is available. On cache updates to watched data, the child component callinguseReadQuery
will re-render with new data but the parent component will not re-render (as it would, for example, if it were usinguseQuery
to issue the request).Consider an
App
component that fetches a list of breeds in the background while also fetching and rendering some information about an individual dog, Mozzarella:View code 🐶
For a detailed explanation of
useBackgroundQuery
anduseReadQuery
, see our fetching with Suspense reference.Document transforms 📑
#10509
79df2c7ba
Thanks @jerelmiller! - Add the ability to specify custom GraphQL document transforms. These transforms are run before reading data from the cache, before local state is resolved, and before the query document is sent through the link chain.To register a custom document transform, create a transform using the
DocumentTransform
class and pass it to thedocumentTransform
option onApolloClient
.For more information on the behavior and API of
DocumentTransform
, see its reference page in our documentation.New
removeTypenameFromVariables
link 🔗#10853
300957960
Thanks @jerelmiller! - Introduce the newremoveTypenameFromVariables
link. This link will automatically remove__typename
fields fromvariables
for all operations. This link can be configured to exclude JSON-scalars for scalars that utilize__typename
.This change undoes some work from #10724 where
__typename
was automatically stripped for all operations with no configuration. This was determined to be a breaking change and therefore moved into this link.For a detailed explanation of
removeTypenameFromVariables
, see its API reference.New
skipToken
sentinel ⏭️#11112
b4aefcfe9
Thanks @jerelmiller! - Adds support for askipToken
sentinel that can be used asoptions
inuseSuspenseQuery
anduseBackgroundQuery
to skip execution of a query. This works identically to theskip
option but is more type-safe and as such, becomes the recommended way to skip query execution. As such, theskip
option has been deprecated in favor ofskipToken
.We are considering the removal of the
skip
option fromuseSuspenseQuery
anduseBackgroundQuery
in the next major. We are releasing with it now to make migration fromuseQuery
easier and makeskipToken
more discoverable.useSuspenseQuery
useBackgroundQuery
For a detailed explanation of
skipToken
, see its API reference.New error extraction mechanism, smaller bundles 📉
#10887
f8c0b965d
Thanks @phryneas! - Add a new mechanism for Error Extraction to reduce bundle size by including error message texts on an opt-in basis.By default, errors will link to an error page with the entire error message.
This replaces "development" and "production" errors and works without
additional bundler configuration.
Bundling the text of error messages and development warnings can be enabled as follows:
For a detailed explanation, see our reference on reducing bundle size.
New
@nonreactive
directive 🎬#10722
c7e60f83d
Thanks @benjamn! - Implement a@nonreactive
directive for selectively skipping reactive comparisons of query result subtrees.The
@nonreactive
directive can be used to mark query fields or fragment spreads and is used to indicate that changes to the data contained within the subtrees marked@nonreactive
should not trigger re-rendering. This allows parent components to fetch data to be rendered by their children without re-rendering themselves when the data corresponding with fields marked as@nonreactive
change.Consider an
App
component that fetches and renders a list of ski trails:View code 🎿
The
Trail
component renders a trail's name and status and allows the user to execute a mutation to toggle the status of the trail between"OPEN"
and"CLOSED"
:View code 🎿
Notice that the
Trail
component isn't receiving the entiretrail
object via props, only theid
which is used along with the fragment document to create a live binding for each trail item in the cache. This allows eachTrail
component to react to the cache updates for a single trail independently. Updates to a trail'sstatus
will not cause the parentApp
component to rerender since the@nonreactive
directive is applied to theTrailFragment
spread, a fragment that includes thestatus
field.For a detailed explanation, see our
@nonreactive
reference and @alessbell's post on the Apollo blog about using@nonreactive
withuseFragment
.Abort the
AbortController
signal more granularly 🛑#11040
125ef5b2a
Thanks @phryneas! -HttpLink
/BatchHttpLink
: Abort theAbortController
signal more granularly.Before this change, when
HttpLink
/BatchHttpLink
created anAbortController
internally, the signal would always be.abort
ed after the request was completed. This could cause issues with Sentry Session Replay and Next.js App Router Cache invalidations, which just replayed the fetch with the same options - including the cancelledAbortSignal
.With this change, the
AbortController
will only be.abort()
ed by outside events, not as a consequence of the request completing.useFragment
drops its experimental label 🎓#10916
ea75e18de
Thanks @alessbell! - Remove experimental labels.useFragment
, introduced in3.7.0
asuseFragment_experimental
, is no longer an experimental API 🎉 We've removed the_experimental
suffix from its named export and have made a number of improvements.For a detailed explanation, see our
useFragment
reference and @alessbell's post on the Apollo blog about usinguseFragment
with@nonreactive
for improved performance when rendering lists.useFragment
improvements#10765
35f36c5aa
Thanks @phryneas! - More robust types for thedata
property onUseFragmentResult
. When a partial result is given, the type is now correctly set toPartial<TData>
.#11083
f766e8305
Thanks @phryneas! - Adjust the rerender timing ofuseQuery
to more closely align withuseFragment
. This means that cache updates delivered to both hooks should trigger renders at relatively the same time. Previously, theuseFragment
might rerender much faster leading to some confusion.#10836
6794893c2
Thanks @phryneas! - Remove the deprecatedreturnPartialData
option fromuseFragment
hook.More Minor Changes
#10895
e187866fd
Thanks @Gelio! - Add generic type parameter for the entity modified incache.modify
. Improves TypeScript type inference for that type's fields and values of those fields.Example:
#10895
e187866fd
Thanks @Gelio! - Use unique opaque types for theDELETE
andINVALIDATE
Apollo cache modifiers.This increases type safety, since these 2 modifiers no longer have the
any
type. Moreover, it no longer triggers the@typescript-eslint/no-unsafe-return
rule.
#10340
4f73c5ca1
Thanks @alessbell! - Avoid callinguseQuery
onCompleted
for cache writes#10527
0cc7e2e19
Thanks @phryneas! - Remove thequery
/mutation
/subscription
option from hooks that already take that value as their first argument.#10506
2dc2e1d4f
Thanks @phryneas! - prevent accidental widening of inferredTData
andTVariables
generics for query hook option arguments#10521 [
fbf729414
](https://togithub.com/apollographql/apollo-client/coConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.